package org.linlinjava.litemall.db.service;

import com.github.yulichang.base.MPJBaseServiceImpl;
import org.linlinjava.litemall.db.dao.LitemallDistributionDetailMapper;
import org.linlinjava.litemall.db.domain.LitemallDistributionDetail;
import org.linlinjava.litemall.db.domain.LitemallDistributionDetailExample;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
 * @program: litemall
 * @description: litemall_reward_rule
 * @author: chenyu
 * @create: 2022-03-15 10:59
 **/
@Service
public class LitemallDistributionDetailService extends MPJBaseServiceImpl<LitemallDistributionDetailMapper,LitemallDistributionDetail> {
  @Resource
  private LitemallDistributionDetailMapper litemallDistributiondetailMapper;

  public void add(LitemallDistributionDetail detail){
    litemallDistributiondetailMapper.insert(detail);
  }


  public List<LitemallDistributionDetail> list(LitemallDistributionDetailExample example){
    return litemallDistributiondetailMapper.selectByExample(example);
  }


  public List<LitemallDistributionDetail> listByLogId(Integer logId){
    LitemallDistributionDetailExample example = new LitemallDistributionDetailExample();
    example.or().andDisLogIdEqualTo(logId);
    return litemallDistributiondetailMapper.selectByExample(example);
  }

  public List<LitemallDistributionDetail> countByLogId(Integer logId){
    LitemallDistributionDetailExample example = new LitemallDistributionDetailExample();
    example.or().andDisLogIdEqualTo(logId);
    return litemallDistributiondetailMapper.selectByExample(example);
  }

}
